package gameObject.item;

import gameObject.effect.BulletEffect;
import gameObject.effect.SwordEffect;
import main.Res;
import base.ItemFrame;

public abstract class ItemSword extends ItemArm{

	protected ItemSword(int id,String name,int cost,int dam,int range,int delay) {
		super(id,name,cost,dam,range,delay);
		frameSequence = new ItemFrame[5];
		frameSequence[0] = new ItemFrame(12,3,0,0);
		frameSequence[1] = new ItemFrame(10,-8,330,0);
		frameSequence[2] = new ItemFrame(0,-14,300,0,true);
		frameSequence[3] = new ItemFrame(13,-5,0,0);
		frameSequence[4] = new ItemFrame(14,3,30,0);
		
		sprite = Res.createArm1Sprite(id);
		sprite.defineReferencePixel(5, 25);
	}
	public BulletEffect createEffect() {
		int l = range-8;
		BulletEffect eff = new SwordEffect(getId(),owner.getX(),owner.getY(), targetX,targetY,
				getDamage(),l*8/3,3);
		eff.moveTo(targetX,targetY, 8);
		return eff;
	}
}
